.calculator {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.form-container {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    min-width: 0;
    width: 100%;
}

/* Ensure single input in a row has the same width as inputs in multi-input rows */
.form-row:has(.form-group:only-child) .form-group {
    max-width: calc(50% - 10px); /* Same width as in a 2-column layout */
}

/* Specific style for product ID form group to match profit value width */
.form-row:first-child .form-group {
    max-width: calc(50% - 10px);
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    text-align: left;
    font-size: 14px;
    color: #333;
}

input, select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    height: 36px;
}

input:focus, select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 5px rgba(74, 144, 226, 0.3);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

button {
    padding: 10px 20px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    height: 36px;
}

button:hover {
    background-color: #357abd;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.error {
    color: #dc3545;
    margin-top: 10px;
    padding: 10px;
    background-color: #f8d7da;
    border-radius: 4px;
}

.result {
    margin-top: 20px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.result-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item .label {
    color: #666;
    font-size: 14px;
}

.result-item .value {
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-right: 5px;
    font-size: 14px;
    color: #666;
    height: 36px;
    display: flex;
    align-items: center;
    outline: none !important;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Add specific focus styles to override browser defaults */
.tab:focus,
.tab:focus-visible,
.tab:focus-within {
    outline: none !important;
    box-shadow: none !important;
    border-color: #ddd;
}

.tab.active {
    background-color: #4a90e2;
    color: white;
    border-color: #4a90e2;
}

.form-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    text-align: left;
    font-size: 14px;
    color: #333;
}

.input-with-button {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-with-button input {
    flex: 1;
}

.query-button {
    padding: 8px 16px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.query-button:hover {
    background-color: #357abd;
}

.query-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
} 